package com.infoauto.opc.gateway.controller;

import com.infoauto.opc.gateway.entity.Result;
import com.infoauto.opc.gateway.entity.ResultCode;
import com.infoauto.opc.gateway.model.gtm4.CheckTheNumberOfUnits1;
import com.infoauto.opc.gateway.model.gtm4.Shift;
import com.infoauto.opc.gateway.service.CheckTheNumberOfUnits1Service;
import com.infoauto.opc.gateway.service.ShiftService;
import com.sun.deploy.net.URLEncoder;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.RegionUtil;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * 班次基础信息
 */

@CrossOrigin
@RestController
@RequestMapping("/shift")
public class ShiftController {
    @Autowired
    private ShiftService service;

    @RequestMapping(value="/selectByPt" ,method= RequestMethod.GET)
    public Result selectByProductionTime(String productiontime){
        try{
            Shift shift1 = service.selectByProductionTime(productiontime);
            return new Result(ResultCode.SUCCESS,shift1);
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
   }
}
